package com.woniuxy.net;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;

public class Demo1 {

	public static void main(String[] args) throws Exception {
		URL url = new URL("http://www.baidu.com/1.zip");
		URLConnection conn = url.openConnection();
		InputStream is = conn.getInputStream();
		
		BufferedReader reader=new BufferedReader(new InputStreamReader(is));
		
		
		BufferedWriter writer=new BufferedWriter(new FileWriter("D:\\baidu.html"));
		
		String s="";
		while((s=reader.readLine())!=null) {
			writer.write(s);
			writer.newLine();
		}
		writer.close();
		reader.close();
		
		//存储到本地，baidu.html
		
		
	}

}
